export const each = (object, iterFunction) => {
  for (var key in object) {
      if (object.hasOwnProperty(key)) {
          var ret = iterFunction.call(this, key, object[key]);
          // if (ret === ALY.util.abort)
          //     break;
      }
  }
}

/**
 * [randomStr 随机串]
 * @param  {[type]} len [description]
 * @return {[type]}     [description]
 */
export const randomStr = (len: number= 32) => {
  var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';
  var maxPos = chars.length;
  var pwd = '';
  for (var i = 0; i < len; i++) {
      pwd += chars.charAt(Math.floor(Math.random() * maxPos));
  }
  return pwd;
}
